<?php
// Declare environment connect to database
include ("include.php");

//security
if (!headers_sent()) {session_start();}
check_security(3);

//xem nguoi dung
//*
if ($REQUEST_METHOD == "POST"){
	session_unregister('session_ngonngu_admin');	
	$session_ngonngu_admin = $ngonngu_admin;	
	session_register('session_ngonngu_admin');
}else{
	session_unregister('session_ngonngu_admin');	
	$session_ngonngu_admin = 1;	
	session_register('session_ngonngu_admin');	
}
//*/


//echo "session_ngonngu_admin: $session_ngonngu_admin<br>";

$admin_user_right = get_session("UserRights");
//echo "$admin_user_right<br>";

//step 1 - string_SQL
$sSQL_header =  " SELECT User_Login FROM user WHERE User_ID=" . tosql(get_session("UserID"),"text") ;
//step 2 - ket noi & query
$stmt= new db_query($dbconn,$sSQL_header);
//step 3 - luu ket qua
if ($stmt->getrow()){
	$user_login = $stmt->row["User_Login"];
}
//echo $user_login;
$dbconn->stmtclose();
$str_html = loadHtml("../htmls/mainleft_admin.htm");
$str_html = ereg_replace("<!--configuration-->","$str_admin_config",$str_html);
$str_html = ereg_replace("<!--user_login-->","$user_login",$str_html);

//echo "DIR_WS_BOXES_ADMIN : ".DIR_WS_BOXES_ADMIN."<br>";

//chon ngon ngu
//print_r ($arr_ngonngu);echo"<br>";
$dd_ngonngu = get_options_array($arr_ngonngu,false,true,"$session_ngonngu_admin") ;
$str_html = ereg_replace("@ngonngu_admin@", $dd_ngonngu, $str_html);

require('../../library/php/includes/boxes/configuration.php');

$str_html = ereg_replace("@config@", $str_config, $str_html);

print $str_html;


?>
